<?php

class KTDGiveMoneyForm extends sfForm{

    public function configure(){
        $this->setWidgets(array(
            "amount" => new sfWidgetFormInputText(array("label"=>"Quantité à donner")),
            "to"     => new sfWidgetFormInputText(array(
                'label'=> "Destinataire",
                
            )),
        ));
        $this->setValidators(array(
            "amount"=> new sfValidatorInteger(array("required" => true), array("required"=>"Il faut donner une somme !")),
            "to"    => new sfValidatorDoctrineChoice(array(
                "model"     => "sfGuardUser",
                "column"    => "pseudo",
                "required"  => true
            ), array("required" => "Requis", "invalid"=>"Ce joueur n'existe pas!"))
        ));
        $this->widgetSchema->setNameFormat("ktd_give_money[%s]");
    }
}

?>
